Skip to content

[GPU] Improve Clamp operation to handle INT64_MIN precision conversion - #39535

Open
sgbihu wants to merge 2 commits into
openvinotoolkit:masterfrom
sgbihu:fix_gpu_int64min
Open

sgbihu wants to merge 2 commits into
openvinotoolkit:masterfrom
sgbihu:fix_gpu_int64min

Conversation

@sgbihu

@sgbihu sgbihu commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Details:

  • Clamp the lower bound to INT32_MIN for i32 GPU Clamp operations before converting bounds to float. This prevents out-of-range convert_int values when the original lower bound is below the i32 range, such as INT64_MIN.
  • Add CPU and GPU functional test cases using ActivationLayerTest for i32 and i64 inputs with lower bounds INT64_MIN, -2147483904, and INT32_MIN.

Tickets:

AI Assistance:

  • AI assistance used: no / yes
  • If yes, summarize how AI was used and what human validation was performed (build/tests/manual checks).

@github-actions github-actions Bot added the category: GPU OpenVINO GPU plugin label Nov 5, 2026
@MayureshV1 MayureshV1 added this to the 2026.5 milestone Nov 5, 2026
@github-actions github-actions Bot added the category: CPU OpenVINO CPU plugin label Nov 5, 2026
@sgbihu
sgbihu marked this pull request as ready for review November 5, 2026 23:45
@sgbihu
sgbihu requested review from a team as code owners November 5, 2026 23:45
@sgbihu
sgbihu requested a balanced review from Copilot November 5, 2026 23:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The GPU Clamp lower-bound change has no active review issues blocking approval.

No open issues 🎉

What changed in this PR

This PR prevents out-of-range lower-bound conversion in GPU Clamp operations when i64 inputs are converted to i32 internally.

Changes:

  • Restrict the GPU i32 Clamp lower bound to at least INT32_MIN.
  • Add CPU and GPU regression cases for i32 and i64 inputs with lower bounds at INT64_MIN, below INT32_MIN, and at INT32_MIN.
File Description
src/​plugins/​intel_gpu/​tests/​functional/​shared_tests_instances/​single_layer_tests/​activation.cpp Adds six GPU Clamp lower-bound regression cases.
src/​plugins/​intel_gpu/​src/​plugin/​ops/​unary.cpp Floors the i32 Clamp lower bound at INT32_MIN before conversion.
src/​plugins/​intel_cpu/​tests/​functional/​shared_tests_instances/​single_layer_tests/​activation.cpp Adds matching CPU Clamp lower-bound regression cases.

Review effort: Balanced

@e-ddykim e-ddykim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: CPU OpenVINO CPU plugin category: GPU OpenVINO GPU plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants